<template>
  <div class="achievement" v-cloak>
    <div class="bg_color"></div>
    <div style="height: 4px;position: absolute;z-index: 2222; width: 100%; top: 46px;background: #f0f0f0"></div>
    <div style="height: 50px;"></div>
    <div class="about-us" v-show="show">
      <div class="content">
        <div class="msgDetail">
          <p v-html="news_detail.ne_content">
          </p>
          <span>{{news_detail.ne_add_time}}</span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  export default {
    name: 'MessageDetail',
    data () {
      return {
        show: false,
        news_detail: {}
      }
    },
    methods: {
      verify: function () {
        var thisObj = this
        this.$chaos.setTitle('消息详情')
        this.$store.commit('headerShow', true)
        this.$store.commit('title', '消息详情')
        this.$store.commit('footerShow', false)
        this.$chaos.verify(function () {
          thisObj.$chaos.ajax({
            data: {
              ne_id: thisObj.$chaos.getQueryString('ne_id')
            },
            slient: true,
            userinfo: true,
            url: 'User/readNews',
            callback: function (type, res) {
              if (res.status === 'SUCCESS') {
                thisObj.news_detail = res.result.news_detail
                thisObj.show = true
              } else {
                thisObj.show = true
                thisObj.$vux.toast.show({
                  text: res.result.msg,
                  type: 'text',
                  width: '180px',
                  position: 'bottom'
                })
              }
            }
          })
        })
      }
    },
    created: function () {
      this.verify()
    },
    mounted: function () {
      window.scrollTo(0, 2000)
    },
    watch: {
      '$route': 'verify'
    }
  }
</script>
<style scoped>
  [v-cloak] {
    display: block;
  }
  body,
  html {
    background: #f9f9f9;
  }
  .content .msgDetail {
    border-bottom: 1px solid rgb(252, 252, 252);
    position: relative;
    padding: 20px 0 30px;
    background: #fff;
  }
  .content .msgDetail p {
    max-height: 100px;
    line-height: 20px;
    padding: 0 5%;
    overflow: hidden;
    font-size: 14px;
  }
  .content .msgDetail span {
    position: absolute;
    color: #999;
    right: 5%;
    font-size: 14px;
    bottom: 10px;
  }
</style>
